#include<bits/stdc++.h>
using namespace std;
int n,a[100005],h[100005],sum[100005];
vector<int> s;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
        h[a[i]]++;
    }
    for(int i=1;i<=100005;i++){
        if(h[i]>0) s.push_back(h[i]);
    }
    sum[1]=s[0];
    for(int i=2;i<=s.size();i++){
        sum[i]=sum[i-1]+s[i-1];
    }
    int ans=0;
    for(int i=1;i<s.size();i++){
        ans=ans+min(s[i],sum[i]-ans);
    }
    cout<<n-ans;
    return 0;
}
